//Written by Richard Lewis aka Trixmoto (c) 2007

function update2(fld,val) {
  //validation
  val = val.replace(/\\/g,'\\\\');
  val = '"'+val+'"';

  //update2
  eval("MyProp."+fld+" = "+val);
  storeaction();
  return true;
}

function evntCommon(obj) {
  var temp = "<tr><td colspan=2>"+obj.onam+".Common.</td></tr>";
  
  temp = temp+"<tr><td class='propnam' width=50%>OnClick</td>";
  temp = temp+"<td width=50%><input type='text' name='ocli' value='"+obj.ocli;
  temp = temp+"' onchange=\"update2('ocli',this.value)\"></td></tr>";  
  
  temp = temp+"<tr><td class='propnam' width=50%>OnResize</td>";
  temp = temp+"<td width=50%><input type='text' name='ores' value='"+obj.ores;
  temp = temp+"' onchange=\"update2('ores',this.value)\"></td></tr>";  
  
  return temp;
}

function evntForm(frm) {
  var html = "<table class='evnts' width=100%><tr><td colspan=2>";
  html += frm.onam+".</td></tr>";
  
  html = html+"<tr><td class='propnam' width=50%>OnClose</td>";
  html = html+"<td width=50%><input type='text' name='oclo' value='"+frm.oclo;
  html = html+"' onchange=\"update2('oclo',this.value)\"></td></tr>";  
  
  html += evntCommon(frm);
  return html+"</table>";
}

function evntActivex(act) {
  var html = "<table class='evnts' width=100%><tr><td colspan=2>";
  html += act.onam+".</td></tr>";
  
  html += "<tr><td class='propnam' width=50%>&nbsp;</td>";
  html += "<td width=50%>&nbsp;</td></tr>";
  
  html += evntCommon(act);
  return html+"</table>";
}

function evntButton(but) {
  var html = "<table class='evnts' width=100%><tr><td colspan=2>";
  html += but.onam+".</td></tr>";
  
  html = html+"<tr><td class='propnam' width=50%>OnClick</td>";
  html = html+"<td width=50%><input type='text' name='oclk' value='"+but.oclk;
  html = html+"' onchange=\"update2('oclk',this.value)\"></td></tr>";  
  
  html += evntCommon(but);
  return html+"</table>";
}

function evntDropDown(drp) {
  var html = "<table class='evnts' width=100%><tr><td colspan=2>";
  html += drp.onam+".</td></tr>";
  
  html = html+"<tr><td class='propnam' width=50%>OnSelect</td>";
  html = html+"<td width=50%><input type='text' name='osel' value='"+drp.osel;
  html = html+"' onchange=\"update2('osel',this.value)\"></td></tr>";  
  
  html += evntCommon(drp);
  return html+"</table>";
}

function evntEdit(edt) {
  var html = "<table class='evnts' width=100%><tr><td colspan=2>";
  html += edt.onam+".</td></tr>";
  
  html += "<tr><td class='propnam' width=50%>&nbsp;</td>";
  html += "<td width=50%>&nbsp;</td></tr>";
  
  html += evntCommon(edt);
  return html+"</table>";
}

function evntCheckBox(chk) {
  var html = "<table class='evnts' width=100%><tr><td colspan=2>";
  html += chk.onam+".</td></tr>";
  
  html += "<tr><td class='propnam' width=50%>&nbsp;</td>";
  html += "<td width=50%>&nbsp;</td></tr>";
  
  html += evntCommon(chk);
  return html+"</table>";
}

function evntLabel(lbl) {
  var html = "<table class='evnts' width=100%><tr><td colspan=2>";
  html += lbl.onam+".</td></tr>";
  
  html += "<tr><td class='propnam' width=50%>&nbsp;</td>";
  html += "<td width=50%>&nbsp;</td></tr>";
  
  html += evntCommon(lbl);
  return html+"</table>";
}

function evntPanel(pan) {
  var html = "<table class='evnts' width=100%><tr><td colspan=2>";
  html += pan.onam+".</td></tr>";
  
  html += "<tr><td class='propnam' width=50%>&nbsp;</td>";
  html += "<td width=50%>&nbsp;</td></tr>";  
  
  html += evntCommon(pan);
  return html+"</table>";
}

function evntRadioButton(rad) {
  var html = "<table class='evnts' width=100%><tr><td colspan=2>";
  html += rad.onam+".</td></tr>";
  
  html += "<tr><td class='propnam' width=50%>&nbsp;</td>";
  html += "<td width=50%>&nbsp;</td></tr>";
  
  html += evntCommon(rad);
  return html+"</table>";
}

function evntSpinEdit(spn) {
  var html = "<table class='evnts' width=100%><tr><td colspan=2>";
  html += spn.onam+".</td></tr>";
  
  html += "<tr><td class='propnam' width=50%>&nbsp;</td>";
  html += "<td width=50%>&nbsp;</td></tr>";
  
  html += evntCommon(spn);
  return html+"</table>";
}

function evntTrackBar(bar) {
  var html = "<table class='evnts' width=100%><tr><td colspan=2>";
  html += bar.onam+".</td></tr>";
  
  html += "<tr><td class='propnam' width=50%>&nbsp;</td>";
  html += "<td width=50%>&nbsp;</td></tr>";
  
  html += evntCommon(bar);
  return html+"</table>";
}

function evntTranspPanel(tra) {
  var html = "<table class='evnts' width=100%><tr><td colspan=2>";
  html += tra.onam+".</td></tr>";
  
  html += "<tr><td class='propnam' width=50%>&nbsp;</td>";
  html += "<td width=50%>&nbsp;</td></tr>";  
  
  html += evntCommon(tra);
  return html+"</table>";
}

function evntDockablePanel(doc) {
  var html = "<table class='evnts' width=100%><tr><td colspan=2>";
  html += doc.onam+".</td></tr>";

  html = html+"<tr><td class='propnam' width=50%>OnClose</td>";
  html = html+"<td width=50%><input type='text' name='oclo' value='"+doc.oclo;
  html = html+"' onchange=\"update2('oclo',this.value)\"></td></tr>";  
  
  html = html+"<tr><td class='propnam' width=50%>OnDockChanged</td>";
  html = html+"<td width=50%><input type='text' name='odoc' value='"+doc.odoc;
  html = html+"' onchange=\"update2('odoc',this.value)\"></td></tr>";  
  
  html += evntCommon(doc);
  return html+"</table>";
}
